package com.ksd.modules.area.controller;

import com.ksd.common.core.result.R;
import com.ksd.modules.area.entity.MayaCity;
import com.ksd.modules.area.request.ProvinceIdRequest;
import com.ksd.modules.area.service.IMayaCityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Auto Generator
 * @since 2023-10-12
 */
@Api(tags = "区域管理-GM")
@RestController
@RequestMapping("/admin/city")
public class MayaCityController {



    @Autowired
    IMayaCityService cityService;






    /**
     * 根据省id搜索市级
     */

    @ApiOperation(value = "根据省id搜索市级")
    @RequestMapping(value = "/search/parentId", method = RequestMethod.POST, consumes = "application/json")
    public R<List<MayaCity>> searchByParentId(@RequestBody ProvinceIdRequest request) {

        return cityService.searchByParentId(request.getParentId());
    }

}
